// 引入request
import request from '@/utils/request'

export const getcommentList = params => {
  return request({
    method: 'GET',
    url: '/v1_0/comments',
    params
  })
}

/**
 * 发布评论
 * @param {*} data
 * {
 * target:评论的目标id(文章id, 评论id)
 * content: 评论内容
 * art_id: 文章id(如果是对文章进行评论不需要该参数)
 * }
 * @returns promise
 */
export const postComment = data => {
  return request({
    method: 'POST',
    url: '/v1_0/comments',
    data
  })
}
